﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CGT.API.Models
{
    /// <summary>
    /// 消息模版
    /// </summary>
    public class TemplateModel
    {

        public TemplateModel()
        {
            //color = "#173177";
        }

        /// <summary>
        /// 接收者openid
        /// </summary>
        public string touser { set; get; }

        /// <summary>
        /// 模板ID
        /// </summary>
        public string template_id { set; get; }

        /// <summary>
        /// 模板跳转链接 
        /// 非必填
        /// </summary>
        public string url { set; get; }

        ///// <summary>
        ///// 跳小程序所需数据，不需跳小程序可不用传该数据
        ///// </summary>
        //public string miniprogram { set; get; }

        ///// <summary>
        ///// 所需跳转到的小程序appid（该小程序appid必须与发模板消息的公众号是绑定关联关系）
        ///// </summary>
        //public string appid { set; get; }

        ///// <summary>
        ///// 所需跳转到小程序的具体页面路径，支持带参数,（示例index?foo=bar）
        ///// </summary>
        //public string pagepath { set; get; }

        /// <summary>
        /// 表单id
        /// </summary>
        public string form_id { set; get; }

        /// <summary>
        /// 口令
        /// </summary>
        public string access_token { set; get; }

        /// <summary>
        /// 模板数据
        /// </summary>
        public object data { set; get; }

        ///// <summary>
        ///// 模板内容字体颜色，不填默认为黑色
        ///// 非必填
        ///// </summary>
        //public string color { set; get; }
    }

    /// <summary>
    /// 消息明细
    /// </summary>
    public class TemplateDataItem
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="v">值</param>
        public TemplateDataItem(string v)
        {
            color = "#173177";
            value = v;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="v">值</param>
        /// <param name="c">颜色</param>
        public TemplateDataItem(string v, string c)
        {
            color = c;
            value = v;
        }

        /// <summary>
        /// 16进制颜色代码，如：#FF0000 
        /// </summary>
        public string color { get; set; }

        /// <summary>
        /// 项目值
        /// </summary>
        public string value { get; set; }
    }
}